{% extends "../layout.html" %}

{% block content %}
<div class="dy-wrapper">
  <form action="{{ url }}" method="post" class="needs-validation" novalidate>
    <div class="row mb-3">
      <label for="name" class="col-sm-2 col-form-label text-end">名称</label>
      <div class="col-sm-10 position-relative">
        <input type="text" class="form-control" id="name" name="name" value="{{ data.name }}" placeholder="请输入名称" required />
        <div class="invalid-tooltip">名称必须填写</div>
      </div>
    </div>
    <div class="row mb-3">
      <label for="is_show" class="col-sm-2 col-form-label text-end">是否显示</label>
      <div class="col-sm-10">
        <input type="radio" class="form-control" id="is_show_0" name="is_show" value="0" {% if data.is_show == 0%} checked {% endif %} />否
        <input type="radio" class="form-control" id="is_show_1" name="is_show" value="1" {% if data.is_show == 1%} checked {% endif %} />是
      </div>
    </div>
    <div class="row mb-3">
      <label for="tid" class="col-sm-2 col-form-label text-end">分类</label>
      <div class="col-sm-10 position-relative">
        <select class="form-select" id="tid" name="tid" required>
          {% for item in collect_types %}
          <option value="{{ item.id }}" {% if data.tid == item.id %}selected{% endif %}>{{ item.name }}</option>
          {% endfor %}
        </select>
        <div class="invalid-tooltip">分类必须选择</div>
    </div>
    <div class="row mb-3">
      <label for="url" class="col-sm-2 col-form-label text-end">地址</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" id="url" name="url" value="{{ data.url }}" placeholder="请输入销售地址" />
      </div>
    </div>
    <div class="row mb-3">
        <label class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <button type="submit" class="btn btn-sky-blue ">保存</button>
        </div>
    </div>
  </form>
</div>
{% endblock %}